package com.tsd.base.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.tsd.base.dao.BaseCodeRuleMapper;
import com.tsd.base.dao.BaseExchangeRateMapper;
import com.tsd.base.dao.BaseExpressOrgMapper;
import com.tsd.base.dao.BasePrinterMapper;
import com.tsd.base.service.BaseDashboardService;
import com.tsd.service.BaseServiceImpl;
import com.tsd.system.dao.SysRegUserMapper;
import com.tsd.system.entity.SysUserExt;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ClassName: BaseDashboardServiceImpl
 * @Description: TODO
 * @Author: Hillpool
 * @Date: 2022/12/27 14:43
 * @Version: 1.0
 */
@Service
public class BaseDashboardServiceImpl extends BaseServiceImpl implements BaseDashboardService {
    @Resource
    BaseCodeRuleMapper baseCodeRuleMapper;
    @Resource
    BaseExpressOrgMapper baseExpressOrgMapper;
    @Resource
    BaseExchangeRateMapper baseExchangeRateMapper;
    //	@Resource
//	SysClientMapper sysClientMapper;
//	@Resource
//	SysSupplierMapper sysSupplierMapper;
    @Resource
    SysRegUserMapper sysRegUserMapper;
    @Resource
    BasePrinterMapper basePrinterMapper;

    @Override
    public JSONObject queryBaseDashboard(SysUserExt opUser) {
        int code_rule_num = baseCodeRuleMapper.countValid();
        int client_num = 0;//sysClientMapper.countValid();
        int supplier_num = 0;//sysSupplierMapper.countValid();
        int express_org_num = baseExpressOrgMapper.countValid();
        int exchange_rate_num = baseExchangeRateMapper.countValid();
        int reg_user_num = sysRegUserMapper.countValid();
        int yun_printer_num = basePrinterMapper.countValid();
        JSONObject object = new JSONObject();
        object.put("code_rule_num", code_rule_num);
        object.put("client_num", client_num);
        object.put("supplier_num", supplier_num);
        object.put("express_org_num", express_org_num);
        object.put("exchange_rate_num", exchange_rate_num);
        object.put("reg_user_num", reg_user_num);
        object.put("yun_printer_num", yun_printer_num);
        return object;
    }

}
